﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;

namespace TrainTicketsAuto
{
    public class WebClientTmall
    {
        private WebClient webclient;
        public string Url;
        public WebClientTmall(string url)
        {
            Url = url;

            webclient = new WebClient();
            webclient.DownloadDataCompleted += new DownloadDataCompletedEventHandler(webclient_DownloadDataCompleted);
            webclient.DownloadDataAsync(new Uri(Url));
        }

        void webclient_DownloadDataCompleted(object sender, DownloadDataCompletedEventArgs e)
        {
            if (!e.Cancelled && e.Error == null)
            {
                byte[] bytes = e.Result;
                string html = Encoding.Default.GetString(bytes);
            }
        }
    }
}
